/**
   This file defines the interface between C++ and NASM assembly.
*/
#ifndef _ASM_HPP_
#define _ASM_HPP_
#define	CODE_SELECTOR		0x18		
#define	DATA_SELECTOR   	0x20		//See also setup/setup.s


extern "C"{ 
  void* 	        memcpy_asm      (void* dst,         void* src,       int size);
  void	                memset_asm      (void* dst,         char  ch ,       int size);
  void                  strcpy_asm      (char  dst[],       const char* src);
  void                  print_asm       (const char* str,   int color);
  void                  sgdt_asm        (type::addr gdt);
  void                  lgdt_asm        (type::addr gdt);
  void                  lidt_asm        (type::addr idt);
  void                  ltr_asm         (int tss_selector);
  void                  lldt_asm        (int ldt_selector);
  void                  debug_pause_asm ();
  void                  outb_asm        (type::u16 port, type::u8 value);
  type::u8              inb_asm         (type::u16 port);
}
extern int cursor; //Using this global var directly is also depreciated.

#endif

/*
  GDT的布局：
  NOP          0x00
  PAGE_DIR     0x08
  PAGE_TABLE   0x10 
  CODE         0x18
  DATA         0x20
  VIDEO        0x28
  TSS1         0x30
  LDT1         0x38
  TSS2         0x40
  LDT2         0x48
  TSS3         0x50
  LDT3         0x58
  TSS4         0x60
  LDT4         0x68
  .
  .
  .
*/
